3.9.32 \(\int \frac {(A+B \tan (e+f x)) \sqrt {c-i c \tan (e+f x)}}{\sqrt {a+i a \tan (e+f x)}} \, dx\) [832]

Optimal. Leaf size=110 \[ -\frac {2 B \sqrt {c} \text {ArcTan}\left (\frac {\sqrt {c} \sqrt {a+i a \tan (e+f x)}}{\sqrt {a} \sqrt {c-i c \tan (e+f x)}}\right )}{\sqrt {a} f}+\frac {(i A-B) \sqrt {c-i c \tan (e+f x)}}{f \sqrt {a+i a \tan (e+f x)}} \]

[Out]

-2*B*arctan(c^(1/2)*(a+I*a*tan(f*x+e))^(1/2)/a^(1/2)/(c-I*c*tan(f*x+e))^(1/2))*c^(1/2)/f/a^(1/2)+(I*A-B)*(c-I*
c*tan(f*x+e))^(1/2)/f/(a+I*a*tan(f*x+e))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.14, antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 45, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3669, 79, 65, 223, 209} \begin {gather*} \frac {(-B+i A) \sqrt {c-i c \tan (e+f x)}}{f \sqrt {a+i a \tan (e+f x)}}-\frac {2 B \sqrt {c} \text {ArcTan}\left (\frac {\sqrt {c} \sqrt {a+i a \tan (e+f x)}}{\sqrt {a} \sqrt {c-i c \tan (e+f x)}}\right )}{\sqrt {a} f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*Tan[e + f*x])*Sqrt[c - I*c*Tan[e + f*x]])/Sqrt[a + I*a*Tan[e + f*x]],x]

[Out]

(-2*B*Sqrt[c]*ArcTan[(Sqrt[c]*Sqrt[a + I*a*Tan[e + f*x]])/(Sqrt[a]*Sqrt[c - I*c*Tan[e + f*x]])])/(Sqrt[a]*f) +
 ((I*A - B)*Sqrt[c - I*c*Tan[e + f*x]])/(f*Sqrt[a + I*a*Tan[e + f*x]])

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 79

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || L
tQ[p, n]))))

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(A+B \tan (e+f x)) \sqrt {c-i c \tan (e+f x)}}{\sqrt {a+i a \tan (e+f x)}} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^{3/2} \sqrt {c-i c x}} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) \sqrt {c-i c \tan (e+f x)}}{f \sqrt {a+i a \tan (e+f x)}}-\frac {(i B c) \text {Subst}\left (\int \frac {1}{\sqrt {a+i a x} \sqrt {c-i c x}} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) \sqrt {c-i c \tan (e+f x)}}{f \sqrt {a+i a \tan (e+f x)}}-\frac {(2 B c) \text {Subst}\left (\int \frac {1}{\sqrt {2 c-\frac {c x^2}{a}}} \, dx,x,\sqrt {a+i a \tan (e+f x)}\right )}{a f}\\ &=\frac {(i A-B) \sqrt {c-i c \tan (e+f x)}}{f \sqrt {a+i a \tan (e+f x)}}-\frac {(2 B c) \text {Subst}\left (\int \frac {1}{1+\frac {c x^2}{a}} \, dx,x,\frac {\sqrt {a+i a \tan (e+f x)}}{\sqrt {c-i c \tan (e+f x)}}\right )}{a f}\\ &=-\frac {2 B \sqrt {c} \tan ^{-1}\left (\frac {\sqrt {c} \sqrt {a+i a \tan (e+f x)}}{\sqrt {a} \sqrt {c-i c \tan (e+f x)}}\right )}{\sqrt {a} f}+\frac {(i A-B) \sqrt {c-i c \tan (e+f x)}}{f \sqrt {a+i a \tan (e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.60, size = 152, normalized size = 1.38 \begin {gather*} \frac {c \sec (e+f x) \left ((A+i B) \left (\cos \left (\frac {1}{2} (e+f x)\right )-i \sin \left (\frac {1}{2} (e+f x)\right )\right )+2 i B \text {ArcTan}(\cos (e+f x)+i \sin (e+f x)) \left (\cos \left (\frac {1}{2} (e+f x)\right )+i \sin \left (\frac {1}{2} (e+f x)\right )\right )\right ) \left (i \cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f \sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Tan[e + f*x])*Sqrt[c - I*c*Tan[e + f*x]])/Sqrt[a + I*a*Tan[e + f*x]],x]

[Out]

(c*Sec[e + f*x]*((A + I*B)*(Cos[(e + f*x)/2] - I*Sin[(e + f*x)/2]) + (2*I)*B*ArcTan[Cos[e + f*x] + I*Sin[e + f
*x]]*(Cos[(e + f*x)/2] + I*Sin[(e + f*x)/2]))*(I*Cos[(e + f*x)/2] + Sin[(e + f*x)/2]))/(f*Sqrt[a + I*a*Tan[e +
 f*x]]*Sqrt[c - I*c*Tan[e + f*x]])

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 322 vs. \(2 (89 ) = 178\).
time = 0.42, size = 323, normalized size = 2.94

method result size
derivativedivides \(-\frac {i \sqrt {-c \left (i \tan \left (f x +e \right )-1\right )}\, \sqrt {a \left (1+i \tan \left (f x +e \right )\right )}\, \left (-2 i B \ln \left (\frac {a c \tan \left (f x +e \right )+\sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}}{\sqrt {a c}}\right ) a c \tan \left (f x +e \right )+B \ln \left (\frac {a c \tan \left (f x +e \right )+\sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}}{\sqrt {a c}}\right ) a c \left (\tan ^{2}\left (f x +e \right )\right )+i A \sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}\, \tan \left (f x +e \right )+i B \sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}-B \ln \left (\frac {a c \tan \left (f x +e \right )+\sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}}{\sqrt {a c}}\right ) a c -B \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}\, \sqrt {a c}\, \tan \left (f x +e \right )+A \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}\, \sqrt {a c}\right )}{f a \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}\, \left (i-\tan \left (f x +e \right )\right )^{2} \sqrt {a c}}\) \(323\)
default \(-\frac {i \sqrt {-c \left (i \tan \left (f x +e \right )-1\right )}\, \sqrt {a \left (1+i \tan \left (f x +e \right )\right )}\, \left (-2 i B \ln \left (\frac {a c \tan \left (f x +e \right )+\sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}}{\sqrt {a c}}\right ) a c \tan \left (f x +e \right )+B \ln \left (\frac {a c \tan \left (f x +e \right )+\sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}}{\sqrt {a c}}\right ) a c \left (\tan ^{2}\left (f x +e \right )\right )+i A \sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}\, \tan \left (f x +e \right )+i B \sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}-B \ln \left (\frac {a c \tan \left (f x +e \right )+\sqrt {a c}\, \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}}{\sqrt {a c}}\right ) a c -B \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}\, \sqrt {a c}\, \tan \left (f x +e \right )+A \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}\, \sqrt {a c}\right )}{f a \sqrt {a c \left (1+\tan ^{2}\left (f x +e \right )\right )}\, \left (i-\tan \left (f x +e \right )\right )^{2} \sqrt {a c}}\) \(323\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c-I*c*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-I/f*(-c*(I*tan(f*x+e)-1))^(1/2)*(a*(1+I*tan(f*x+e)))^(1/2)/a*(-2*I*B*ln((a*c*tan(f*x+e)+(a*c)^(1/2)*(a*c*(1+t
an(f*x+e)^2))^(1/2))/(a*c)^(1/2))*a*c*tan(f*x+e)+B*ln((a*c*tan(f*x+e)+(a*c)^(1/2)*(a*c*(1+tan(f*x+e)^2))^(1/2)
)/(a*c)^(1/2))*a*c*tan(f*x+e)^2+I*A*(a*c*(1+tan(f*x+e)^2))^(1/2)*(a*c)^(1/2)*tan(f*x+e)+I*B*(a*c*(1+tan(f*x+e)
^2))^(1/2)*(a*c)^(1/2)-B*ln((a*c*tan(f*x+e)+(a*c)^(1/2)*(a*c*(1+tan(f*x+e)^2))^(1/2))/(a*c)^(1/2))*a*c-B*(a*c*
(1+tan(f*x+e)^2))^(1/2)*(a*c)^(1/2)*tan(f*x+e)+A*(a*c*(1+tan(f*x+e)^2))^(1/2)*(a*c)^(1/2))/(a*c*(1+tan(f*x+e)^
2))^(1/2)/(I-tan(f*x+e))^2/(a*c)^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.56, size = 150, normalized size = 1.36 \begin {gather*} -\frac {{\left (2 \, B \arctan \left (\cos \left (f x + e\right ), \sin \left (f x + e\right ) + 1\right ) + 2 \, B \arctan \left (\cos \left (f x + e\right ), -\sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (i \, A - B\right )} \cos \left (f x + e\right ) + i \, B \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + 2 \, \sin \left (f x + e\right ) + 1\right ) - i \, B \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (A + i \, B\right )} \sin \left (f x + e\right )\right )} \sqrt {c}}{2 \, \sqrt {a} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-I*c*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

-1/2*(2*B*arctan2(cos(f*x + e), sin(f*x + e) + 1) + 2*B*arctan2(cos(f*x + e), -sin(f*x + e) + 1) - 2*(I*A - B)
*cos(f*x + e) + I*B*log(cos(f*x + e)^2 + sin(f*x + e)^2 + 2*sin(f*x + e) + 1) - I*B*log(cos(f*x + e)^2 + sin(f
*x + e)^2 - 2*sin(f*x + e) + 1) - 2*(A + I*B)*sin(f*x + e))*sqrt(c)/(sqrt(a)*f)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 366 vs. \(2 (88) = 176\).
time = 13.11, size = 366, normalized size = 3.33 \begin {gather*} \frac {{\left (a f \sqrt {-\frac {B^{2} c}{a f^{2}}} e^{\left (i \, f x + i \, e\right )} \log \left (\frac {4 \, {\left (2 \, {\left (B e^{\left (3 i \, f x + 3 i \, e\right )} + B e^{\left (i \, f x + i \, e\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} + {\left (a f e^{\left (2 i \, f x + 2 i \, e\right )} - a f\right )} \sqrt {-\frac {B^{2} c}{a f^{2}}}\right )}}{B e^{\left (2 i \, f x + 2 i \, e\right )} + B}\right ) - a f \sqrt {-\frac {B^{2} c}{a f^{2}}} e^{\left (i \, f x + i \, e\right )} \log \left (\frac {4 \, {\left (2 \, {\left (B e^{\left (3 i \, f x + 3 i \, e\right )} + B e^{\left (i \, f x + i \, e\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} - {\left (a f e^{\left (2 i \, f x + 2 i \, e\right )} - a f\right )} \sqrt {-\frac {B^{2} c}{a f^{2}}}\right )}}{B e^{\left (2 i \, f x + 2 i \, e\right )} + B}\right ) - 2 \, {\left ({\left (-i \, A + B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}\right )} e^{\left (-i \, f x - i \, e\right )}}{2 \, a f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-I*c*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

1/2*(a*f*sqrt(-B^2*c/(a*f^2))*e^(I*f*x + I*e)*log(4*(2*(B*e^(3*I*f*x + 3*I*e) + B*e^(I*f*x + I*e))*sqrt(a/(e^(
2*I*f*x + 2*I*e) + 1))*sqrt(c/(e^(2*I*f*x + 2*I*e) + 1)) + (a*f*e^(2*I*f*x + 2*I*e) - a*f)*sqrt(-B^2*c/(a*f^2)
))/(B*e^(2*I*f*x + 2*I*e) + B)) - a*f*sqrt(-B^2*c/(a*f^2))*e^(I*f*x + I*e)*log(4*(2*(B*e^(3*I*f*x + 3*I*e) + B
*e^(I*f*x + I*e))*sqrt(a/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(c/(e^(2*I*f*x + 2*I*e) + 1)) - (a*f*e^(2*I*f*x + 2*I*
e) - a*f)*sqrt(-B^2*c/(a*f^2)))/(B*e^(2*I*f*x + 2*I*e) + B)) - 2*((-I*A + B)*e^(2*I*f*x + 2*I*e) - I*A + B)*sq
rt(a/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(c/(e^(2*I*f*x + 2*I*e) + 1)))*e^(-I*f*x - I*e)/(a*f)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {- i c \left (\tan {\left (e + f x \right )} + i\right )} \left (A + B \tan {\left (e + f x \right )}\right )}{\sqrt {i a \left (\tan {\left (e + f x \right )} - i\right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-I*c*tan(f*x+e))**(1/2)*(A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(-I*c*(tan(e + f*x) + I))*(A + B*tan(e + f*x))/sqrt(I*a*(tan(e + f*x) - I)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-I*c*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^(1/2),x, algorithm="giac")

[Out]

integrate((B*tan(f*x + e) + A)*sqrt(-I*c*tan(f*x + e) + c)/sqrt(I*a*tan(f*x + e) + a), x)

________________________________________________________________________________________

Mupad [B]
time = 12.16, size = 250, normalized size = 2.27 \begin {gather*} \frac {A\,\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}\,1{}\mathrm {i}}{f\,\sqrt {a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}}-\frac {4\,B\,\sqrt {c}\,\mathrm {atan}\left (\frac {\sqrt {c}\,\left (\sqrt {a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}{\sqrt {a}\,\left (\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-\sqrt {c}\right )}\right )}{\sqrt {a}\,f}-\frac {4\,B\,\left (\sqrt {a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}{f\,\left (\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-\sqrt {c}\right )\,\left (-\frac {a}{c}+\frac {{\left (\sqrt {a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}^2}{{\left (\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-\sqrt {c}\right )}^2}+\frac {2\,\sqrt {a}\,\left (\sqrt {a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}{\sqrt {c}\,\left (\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-\sqrt {c}\right )}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(c - c*tan(e + f*x)*1i)^(1/2))/(a + a*tan(e + f*x)*1i)^(1/2),x)

[Out]

(A*(c - c*tan(e + f*x)*1i)^(1/2)*1i)/(f*(a + a*tan(e + f*x)*1i)^(1/2)) - (4*B*c^(1/2)*atan((c^(1/2)*((a + a*ta
n(e + f*x)*1i)^(1/2) - a^(1/2)))/(a^(1/2)*((c - c*tan(e + f*x)*1i)^(1/2) - c^(1/2)))))/(a^(1/2)*f) - (4*B*((a
+ a*tan(e + f*x)*1i)^(1/2) - a^(1/2)))/(f*((c - c*tan(e + f*x)*1i)^(1/2) - c^(1/2))*(((a + a*tan(e + f*x)*1i)^
(1/2) - a^(1/2))^2/((c - c*tan(e + f*x)*1i)^(1/2) - c^(1/2))^2 - a/c + (2*a^(1/2)*((a + a*tan(e + f*x)*1i)^(1/
2) - a^(1/2)))/(c^(1/2)*((c - c*tan(e + f*x)*1i)^(1/2) - c^(1/2)))))

________________________________________________________________________________________